home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / Source / Foundation / OS / ZHelpMessage.h < prev    next >
Text File  |  1996-10-28  |  2KB  |  79 lines

  1. /*
  2.  *  File:       ZHelpMessage.h
  3.  *  Summary:       A class that encapsulates a HMMessageRecord (ie the stuff in a help balloon).
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):    
  10.  *
  11.  *         <->     8/01/96    JDJ        Created
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <Balloons.h>
  17. #include <string>
  18.  
  19. #include <ZTypes.h>
  20.  
  21.  
  22. // ===================================================================================
  23. //    struct THelpMessage
  24. // ===================================================================================
  25. struct THelpMessage {
  26.  
  27. //-----------------------------------
  28. //    Initialization/Destruction
  29. //
  30. public:
  31.                         THelpMessage();
  32.                         // Inits message to an empty string.
  33.  
  34.                         THelpMessage(ResType type, ResID id);
  35.                         // Type can be 'STR ', 'PICT', or 'TEXT'. Note that 'TEXT'
  36.                         // requires a 'styl' resource with the same id.
  37.  
  38.                         THelpMessage(ResType type, ResID id, short index);
  39.                         // Type must be 'STR#'.
  40.  
  41.                         THelpMessage(const string& mesg);
  42.  
  43. //-----------------------------------
  44. //    Conversion Operators
  45. //
  46. public:
  47.                         operator const HMMessageRecord*() const            {return &mMessage;}
  48.  
  49. //-----------------------------------
  50. //    Comparison Operators
  51. //
  52. public:
  53.             bool        operator==(const THelpMessage& rhs) const;
  54.  
  55.             bool        operator!=(const THelpMessage& rhs) const        {return !(*this == rhs);}
  56.             
  57.             bool        IsEmpty() const;
  58.                         // Returns true if the message is an empty string.
  59.  
  60. //-----------------------------------
  61. //    Accesors
  62. //
  63. public:
  64.             ResType     GetType() const;
  65.                         // 'STRL' is used for string literals.
  66.             
  67.             ResID         GetID() const;
  68.             
  69.             short         GetIndex() const;
  70.             
  71.             string         GetStringLiteral() const;
  72.  
  73. //-----------------------------------
  74. //    Member data
  75. //
  76. private:
  77.     HMMessageRecord        mMessage;
  78. };
  79.